package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.dict.entity.DictItem;
import com.fz.us.oa.core.entity.common.FileManage;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 业务实体类 - 资产报废登记表
 * ============================================================================
 * 版权所有 2017 。
 *
 * @author XuHeng
 * @version 1.0 2017-02-17 。
 * ============================================================================
 */
@Entity
@Table(name="ec_assetscrap")
public class AssetScrap extends BaseFlowEntity {

    private static final long serialVersionUID = 8963572739452087762L;
    /**
     * 对应的资产入库登记表
     */
    private Asset asset;

    /**
     * 资产名称 name
     */

    /**
     * 报废原因
     */
    private DictItem dictItem;

    /**
     * 已提折旧（元）
     */
    private Double numYTZJMoney;

    /**
     * 净值（元）
     */
    private Double numNetMoney;

    /**
     * 残值（元）
     */
    private Double numLeftMoney;

    /**
     * 相关附件
     */
    private List<FileManage> file;

    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;

    /**
     * 表单名称
     */
    private String form;
    /**
     * 创建方式 0普通的新建 1从资产维修自动创建
     */
    private int createType;

    @Column(nullable=false, columnDefinition = "varchar(50) default '资产维修登记表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Asset getAsset() {
        return asset;
    }

    public void setAsset(Asset asset) {
        this.asset = asset;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public DictItem getDictItem() {
        return dictItem;
    }

    public void setDictItem(DictItem dictItem) {
        this.dictItem = dictItem;
    }

    public Double getNumYTZJMoney() {
        return numYTZJMoney;
    }

    public void setNumYTZJMoney(Double numYTZJMoney) {
        this.numYTZJMoney = numYTZJMoney;
    }

    public Double getNumNetMoney() {
        return numNetMoney;
    }

    public void setNumNetMoney(Double numNetMoney) {
        this.numNetMoney = numNetMoney;
    }

    public Double getNumLeftMoney() {
        return numLeftMoney;
    }

    public void setNumLeftMoney(Double numLeftMoney) {
        this.numLeftMoney = numLeftMoney;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_assetscrap_file", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFile() {
        return file;
    }

    public void setFile(List<FileManage> file) {
        this.file = file;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }

    public int getCreateType() {
        return createType;
    }

    public void setCreateType(int createType) {
        this.createType = createType;
    }
}
